package com.lxw.redis.study.core;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class TreeNode<T> {
    private Object id;
    private Object parentId;
    private Integer level;
    private Integer sort;
    private String label;
    private Boolean root;
    private Boolean leaf;
    private T data;
    private List<TreeNode<T>> children = new ArrayList<>();

    public TreeNode(T data) {
        this.data = data;
    }

    public void addChildren(TreeNode<T> node) {
        children.add(node);
    }
}
